package com.ermax.aircond.maintain.domain;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.ermax.aircond.common.domain.CommonDomain;

@Entity
@Table(name = "FLOOR")
public class Floor extends CommonDomain implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "FLOOR_ID")
	private long floorId;
	private int floorNo;
	private String floorName;
	private String status;
	private String floorType;
	private String description;
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "BUILDING_ID")
	private Building building;
	@OneToMany(mappedBy = "floor")
	private List<Room> rooms = new ArrayList<Room>();
	
	@Lob
	@Basic(fetch=FetchType.LAZY)
	private byte[] floorPlan;
		
	
	public List<Room> getRooms() {
		return rooms;
	}

	public void setRooms(List<Room> rooms) {
		this.rooms = rooms;
	}

	public long getFloorId() {
		return floorId;
	}

	public void setFloorId(long floorId) {
		this.floorId = floorId;
	}

	public Building getBuilding() {
		return building;
	}

	public void setBuilding(Building building) {
		this.building = building;
	}

	public int getFloorNo() {
		return floorNo;
	}

	public void setFloorNo(int floorNo) {
		this.floorNo = floorNo;
	}

	public String getFloorName() {
		return floorName;
	}

	public void setFloorName(String floorName) {
		this.floorName = floorName;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getFloorType() {
		return floorType;
	}

	public void setFloorType(String floorType) {
		this.floorType = floorType;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public byte[] getFloorPlan() {
		return floorPlan;
	}

	public void setFloorPlan(byte[] floorPlan) {
		this.floorPlan = floorPlan;
	}
	

}
